package com.ruitu.health_1.mvp.model;

import com.ruitu.arad.api.RxUtil;
import com.ruitu.arad.base.BaseModel;
import com.ruitu.health_1.dao.http.APIRetrofit;
import com.ruitu.router_module.bean.BaseResult2;
import com.ruitu.router_module.bean.user.User;

import io.reactivex.Observable;
import okhttp3.RequestBody;

public class LoginModel {
    public static class LoginM extends BaseModel {
        public Observable<BaseResult2<User>> login(RequestBody body) {
            return APIRetrofit.getDefault().login(body)
                    .compose(RxUtil.<BaseResult2<User>>subIoObMain());
        }

        public Observable<BaseResult2<User>> loginyan(RequestBody body) {
            return APIRetrofit.getDefault().loginyan(body)
                    .compose(RxUtil.<BaseResult2<User>>subIoObMain());
        }

        public Observable<BaseResult2> doyzm(RequestBody body) {
            return APIRetrofit.getDefault().doyzm(body)
                    .compose(RxUtil.<BaseResult2>subIoObMain());
        }
    }

    public static class RegisterM extends BaseModel {
        public Observable<BaseResult2> register(RequestBody body) {
            return APIRetrofit.getDefault().register(body)
                    .compose(RxUtil.<BaseResult2>subIoObMain());
        }

        public Observable<BaseResult2> doyzm(RequestBody body) {
            return APIRetrofit.getDefault().doyzm(body)
                    .compose(RxUtil.<BaseResult2>subIoObMain());
        }

    }

}
